<?php if (isset($exam) && $exam) { ?>
<div>
	<div>
		<label>Thời gian bắt đầu làm bài : </label><?php echo date('d/m/Y H:i', $exam->start) ?>
	</div>
	<div>
		<label>Tổng số điểm : </label><strong><span style="color:red"><?php echo $exam->getMark() ?></span></strong>
	</div>
	<div>
		<label>Thời gian làm bài thi : </label><strong><span style="color:red"><?php echo $exam->getTimeExam() ?></span></strong>
	</div>
</div>

<div class="exam">
	<ul>
		<?php 
			foreach ($detail as $index => $value) {
				$ques = json_decode($value->question_params);
				$arrAnswer =  json_decode($value->answer_params, true);
		?>
		<li class="question">
			<p class="no">Câu <?php echo ($index + 1)  . " : "?></p>
			<p class="title"><?php echo $ques->title ?></p>
			
			<?php if (isset($arrAnswer[Question::ISingle])) {?>
			<ul class="answer">
			<?php foreach ($arrAnswer[Question::ISingle] as $key => $ans) {?>
				<li>
					<p class="title<?php echo $ans['checked'] ? " checked" : "" ?>">
						<?php echo ($key + 1) ?>.
						<label for="<?php echo $index.$key ?>"><?php echo $ans['title'] ?></label>
					</p>
				</li>
			<?php }?>
			</ul>
			<?php }elseif (isset($arrAnswer[Question::IText])) {?>
				<p class="text"><?php echo $arrAnswer[Question::IText]; ?></p>
			<?php }?>
		</li>
		<?php }?>
	</ul>
</div>

<?php } ?>